package util;

import java.util.ArrayList;

/**
* @author Sebastian
* @author Gottschalk
* @author Piesold
*/
public enum Colour {

  GREEN ( "gruen"    ),
	BLUE  ( "blau"    ),
	BLACK ( "schwarz" ),
	GREY  ( "grau"    ),
	RED   ( "rot"     );

	private String name = "";

	/**
	 * @param name
	 *            the name
	 */
	private Colour(String name) {
		this.name = name;
	}

	/**
	 * @return the name of the <code>Colour</code>
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * @return an <code>ArrayList< Colour ></code> with all possible
	 *         <code>Colours</code>s
	 */
	public static ArrayList<Colour> getAll() {
		ArrayList<Colour> list = new ArrayList<Colour>();
		for (Colour c : Colour.class.getEnumConstants())
			list.add(c);
		return list;
	}

	public static Colour find( String colour ) {
		Colour c = null;
		for (Colour col : Colour.class.getEnumConstants())
			if ( col.getName().equalsIgnoreCase( colour ) )
				c = col;
		return c;
	}

}